import request from '@/utils/request'
/**
 * @description: 获取角色列表
 * @param {*} params:{page 页码, pagesize 每页的条数}
 * @return {*}
 */
export function fetchRoleList(params) {
  return request({
    method: 'get',
    url: '/sys/role',
    params
  })
}
export function fetchDelRole(id) {
  return request({
    method: 'DELETE',
    url: `/sys/role/${id}`
  })
}

export function fetchAddRole(data) {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}

export function fetchGetRoleDetial(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'GET'
  })
}

export function fetchUpdateRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT'
  })
}
